/**
 * Created with Intellij JDEA
 * Description:
 * User:
 * Date:2022-03-27
 * Time:19:32
 */
public class 找出缺失的观测数据 {
    public int[] missingRolls(int[] rolls, int mean, int n) {
        int x,y;
        int ret = 0;
        int len = rolls.length + n;
        int tmp = mean * len;
        for(int i = 0;i < rolls.length;i++){
            tmp -= rolls[i];
        }
        if(tmp < n || tmp > 6 * n){
            return new int[0];
        }
        int quotient = tmp / n, remainder = tmp % n;
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = quotient + (i < remainder ? 1 : 0);
        }
        return arr;
    }
}
